package study.cv.opencv.support.utils;

import com.google.common.collect.Lists;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;

import java.util.List;

/**
 * 轮廓
 */
public final class ContourUtils {

    /**
     *
     */
    public static Mat drawContours(Mat src, List<MatOfPoint> contours) {
        Imgproc.drawContours(src, contours, 0, new Scalar(255), 3);
        return src;
    }

    public static Mat drawContours(Mat src, MatOfPoint contour) {
        return drawContours(src, Lists.newArrayList(contour));
    }
}
